package com.contextor.magiccards.dao;

import com.contextor.magiccards.model.Entity;
import com.contextor.magiccards.model.errors.MagicCardsException;

import java.io.Serializable;

/**
 * User: sergey
 * Date: Mar 10, 2011 4:12:22 PM
 */
public interface GenericDao<T extends Entity, PK extends Serializable> {

    T getById(int shardId, PK pk);

    T loadById(int shardId, PK pk);

    void save(int shardId, T t);

    void remove(int shardId, PK pk) throws Exception;

    T exist(int shardId, PK pk) throws MagicCardsException;
}
